package com.xiaoshuidi.cloud.module.report.convert.ajreport;

import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.report.controller.ajreport.vo.*;
import com.xiaoshuidi.cloud.module.report.dal.DO.ContractRoommateDO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportLedgerInfoDO;
import com.xiaoshuidi.cloud.module.report.service.ajreport.dto.ReportLedgerInfoDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 台账报表 转换类
 */
@Mapper
public interface LedgerReportConvert {

    LedgerReportConvert INSTANCE = Mappers.getMapper(LedgerReportConvert.class);

    @Mapping(source = "startTime", target = "startTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "endTime", target = "endTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "actualEndTime", target = "actualEndTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "signedTime", target = "signedTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "oldStartTime", target = "oldStartTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "oldEndTime", target = "oldEndTime", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "newContractDate", target = "newContractDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "firstContractDate", target = "firstContractDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "rentDeliveryDate", target = "rentDeliveryDate", dateFormat = "yyyy-MM-dd")
    @Mapping(source = "evictionTime", target = "evictionTime", dateFormat = "yyyy-MM-dd")
    ReportLedgerInfoDto convert(ReportLedgerInfoDO reportLedgerInfoDO);

    PageResult<ReportLedgerInfoDto> convert(PageResult<ReportLedgerInfoDO> page);

    PageResult<RentingLedgerRespVO> convertRentingLedgerPage(PageResult<ReportLedgerInfoDto> page);

    PageResult<RenewalLedgerRespVO> convertRenewalLedgerPage(PageResult<ReportLedgerInfoDto> page);

    PageResult<ExchangeLedgerRespVO> convertExchangeLedgerPage(PageResult<ReportLedgerInfoDto> page);

    PageResult<RentingOutLedgerRespVO> convertRentingoutLedgerPage(PageResult<ReportLedgerInfoDto> page);

    ContractRoommateRespVO convertRoommate(ContractRoommateDO roommateDO);

    List<ContractRoommateRespVO> convertRoommateList(List<ContractRoommateDO> page);

}

